<?php
namespace app\index\listener;

use think\facade\Db;

class Admin
{
    public function handle($data)
    {
        $ws = app('think\swoole\Websocket');
        $fd = Db::name('app_customer_connect')->where('id', $data->connect_id)->value('user_fd');
        $ws->to($fd)->emit('customerMessage', $data);
    }
}